/************************************************************
	File:		Ship.h
	Author:		Doug Monroe (dmonroe@fullsail.com)
	Course:		SGD 1304
	Purpose:	CShip class handles the user's ship entity
************************************************************/


#pragma once

#include "Entity.h"
#include "../../SGD Wrappers/IListener.h"


//***********************************************************
// CShip class
//	- user-controlled entity
//	- overrides Update & Render methods
//	- overrides HandleEvent to listen for
//		- "INCREASE_SCORE"	w/ int* points parameter
class CShip : public CEntity, public IListener
{
public:
	//*******************************************************
	CShip( void );
	virtual ~CShip( void );

	
	//*******************************************************
	// IEntity Interface:
	virtual void Update( float fElapsedTime )		override;
	virtual void Render( void )						override;
	virtual bool CheckCollision( IEntity* pOther )	override;

	// CANNOT override the 'final' methods from CEntity
	//virtual void AddRef( void )  				override;
	
	
	//*******************************************************
	// IListener Interface:
	virtual void HandleEvent( CEvent* pEvent )		override;




	//*******************************************************
	// Accessors:
	int		GetHealth	( void ) const	{	return m_nHealth;	}
	int		GetAmmo		( void ) const	{	return m_nAmmo;		}
	int		GetScore	( void ) const	{	return m_nScore;	}
	
	// Mutators:
	void	SetHealth	( int	h ) 	{	m_nHealth	= h;	}
	void	SetAmmo		( int	a ) 	{	m_nAmmo		= a;	}
	void	SetScore	( int	s ) 	{	m_nScore	= s;	}


private:
	//*******************************************************
	// Attributes:
	int		m_nHealth;
	int		m_nAmmo;
	int		m_nScore;
	float	m_fRespawnTimer;
	
	// movement
	enum	ShipThrustState		{ THRUST_NONE = 0x0, THRUST_FORWARD = 0x1, THRUST_REVERSE = 0x2, THRUST_LEFT_TURN = 0x4, THRUST_RIGHT_TURN = 0x8 };
	int		m_nThrustState;
	
	// asset IDs
	int		m_nShipThrustSfxID;
	int		m_nShipTurnSfxID;
};

